<!-- 单项工程列表-综合查询 -->
<template>
  <TCollapse title="单项工程列表">
    <iframe :src="baseDetailsUrl" scrolling="no" width="100%" :height="basicHeight" frameborder="0" />
  </TCollapse>
</template>
<script>

import TCollapse from '@/components/basic/TCollapse.vue'

export default {
  name: 'JnPrjDetail',
  components: { TCollapse },
  props: {
    prjId: {
      type: String,
      default: '',
      required: true
    }
  },
  data() {
    return {
      basicHeight: ''
    }
  },
  computed: {
    baseDetailsUrl() {
      return `${process.env.VUE_APP_JUNNAN_IFRAME_URL}design/projectBasicInfo?prjId=${this.prjId}`
    }
  },
  async created() {
    window.addEventListener('message', (event) => {
      const base_url = ''
      if (event.origin === base_url) {
        return
      }
      if (event.data.type === 'basicHeight') {
        this.basicHeight = event.data.data
      }
    })
  }
}
</script>

<style scoped lang='scss'>
</style>
